<?php
$date_att = array(
			'name'			=> 'gen_datepicker',
			'class'			=> 'gen_datepicker',
			'placeholder' 	=> 'Enter date...',
            );
$att_options = array(
				'1'=>'Present',
				'0'=>'Absent',
				'2'=>'Tardy',
				'3'=>'Cut Class'
);
?>
<div class="row">
	<div class="panel callout"><h6>New Attendance</h6></div>
		<?if(isset($system_message)) echo $system_message;?>
			
		<?require 'navigation/class_nav.php'?>
		<?if(!empty($now_att)):?>
			<?=form_open('teacher/new_attendance/' . $room_id, array('class'=>'custom submit_forms')); ?>
				<div class="row collapse">
					<div class="small-3 large-2 columns">
						<span class="prefix">Date</span>
					</div>
					<div class="small-9 large-10 columns">
						<?=form_input($date_att);?>
					</div>
				</div>
				<table>
					<thead>
						<tr>
							<th>Student Name</th>
							<th>Attendance</th>
							<th>Reason</th>
							<th>Remarks</th>
						</tr>
					</thead>
					<tbody>
						<?foreach($now_att as $att): ?>
						<?$id = $att->profile_id; ?>
						<?$id_arr[] = $id; ?>
							<tr>
								<td><?=strtoupper($att->lastname) . ', ' . ucfirst($att->firstname) . ' ' . ucfirst($att->middlename); ?><br />
									<?=$att->profile_id?>
								</td>
								<td><?=form_dropdown('attendance[' . $id . '][in_class]', $att_options,'','id="customDropdown"'); ?></td>
								<td><?=form_input('attendance[' . $id . '][reason]','','class="large-12 columns"'); ?></td>
								<td><?=form_input('attendance[' . $id . '][remarks]','','class="large-12 columns"'); ?></td>
							</tr>
						<?endforeach;?>
					</tbody>				
				</table>
			<?=form_hidden('section_id', $section_id); ?>
			<?=form_hidden('id_arr', $id_arr); ?>
			<a href="#" class="button small success submit_btns">Create Attendance</a>
			<?=form_close();?>
		<?else:?>
			<div data-alert class="alert-box">No students assigned to room yet.</div>
		<?endif;?>
		
</div>